package com.ruicar.afs.cloud.product.job;

import com.ruicar.afs.cloud.common.job.core.biz.model.ReturnT;
import com.ruicar.afs.cloud.common.job.core.handler.annotation.AfsJob;
import com.ruicar.afs.cloud.common.job.core.handler.annotation.AfsJobHandler;
import com.ruicar.afs.cloud.product.service.LprConfigurationService;
import com.ruicar.afs.cloud.product.service.ProductPlanService;
import com.ruicar.afs.cloud.product.service.ProductUpdateService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@AfsJob
@AllArgsConstructor
@Slf4j
@Component
public class productJob {

    private final LprConfigurationService lprConfigurationService;
    private final ProductUpdateService productUpdateService;
    private final ProductPlanService productPlanService;

    /**
     * @Description 最新的LPR实时生效
     */
    @AfsJobHandler(value = "timingTriggerLPR")
    public ReturnT<String> timingTriggerLPR(String a) {
        lprConfigurationService.timingTriggerLPR();
        return ReturnT.SUCCESS;
    }

    /**
     * @Description 产品批量修改定时任务
     */
    @AfsJobHandler(value = "timingTaskProductUpdate")
    public ReturnT<String> timingTaskProductUpdate(String a) {
        productUpdateService.timingTaskProductUpdate();
        return ReturnT.SUCCESS;
    }

    /**
     * @Description 产品批量下线定时任务
     */
    @AfsJobHandler(value = "timingTaskProductOffline")
    public ReturnT<String> timingTaskProductOffline(String a) {
        productPlanService.timingTaskProductOffline();
        return ReturnT.SUCCESS;
    }


}
